:root {
  --header-height: 64px;
  --footer-height: 56px;
}

.page {
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.page-home {
  overflow: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: var(--site-header-background, rgba(16, 31, 64, 0.68));
  border-bottom: 1px solid var(--color-border-soft);
}

.site-nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-primary);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color var(--transition-fast);
}

.site-nav__brand svg {
  color: var(--color-primary);
}

.site-nav__links {
  display: none;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--font-size-sm);
}

.site-nav__link {
  color: var(--color-text-secondary);
  padding: 0.35rem 0;
  position: relative;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -6px;
  height: 2px;
  background: var(--color-interactive, var(--color-primary));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-fast);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--color-interactive, var(--color-primary));
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after {
  transform: scaleX(1);
}

.site-nav__link.is-active {
  color: var(--color-interactive, var(--color-primary));
}

.site-nav__link.is-active::after {
  transform: scaleX(1);
}

.site-nav__toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: var(--color-surface, rgba(230, 233, 239, 0.04));
}

.site-nav__toggle:hover,
.site-nav__toggle:focus-visible {
  border-color: var(--color-interactive, var(--color-primary));
  color: var(--color-interactive, var(--color-primary));
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--color-border-soft);
  background: var(--surface-overlay, rgba(11, 12, 16, 0.85));
  backdrop-filter: blur(12px);
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu__list {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-4);
}

.mobile-menu__link {
  color: var(--color-text-secondary);
}

.mobile-menu__link:hover,
.mobile-menu__link:focus-visible {
  color: var(--color-interactive, var(--color-primary));
}

.mobile-menu__link.is-active {
  color: var(--color-interactive, var(--color-primary));
}

@media (min-width: 768px) {
  .site-nav__links {
    display: flex;
  }
  .site-nav__toggle {
    display: none;
  }
  .mobile-menu {
    display: none !important;
  }
}

.page main {
  width: 100%;
}

[data-page-root] {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
  padding-block-start: clamp(2rem, 5vw, 3.5rem);
  padding-block-end: clamp(3rem, 6vw, 5rem);
  background: radial-gradient(circle at top left, var(--glow-hero, rgba(22, 93, 255, 0.08)), transparent 55%);
  position: relative;
}

[data-page-root] > section {
  margin: 0;
}

.page-hero {
  padding-block: clamp(1rem, 1vw, 4.5rem);
  position: relative;
  border-bottom: 1px solid var(--color-border-hairline, rgba(230, 233, 239, 0.04));
  background: linear-gradient(145deg, var(--color-surface-xweak, rgba(230, 233, 239, 0.02)), transparent 65%);
}

.page-hero__layout {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
}
.page-hero__layout--split {
  align-items: center;
}
@media (min-width: 1024px) {
  .page-hero__layout--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}
.page-hero__content {
  display: grid;
  gap: var(--space-4);
  max-width: 640px;
}
.page-hero__content > *:last-child {
  margin-bottom: 0;
}

.page-hero__page-title {
  display: none;
}

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-hero__title {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.15;
}

.page-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--color-surface-stronger, rgba(230, 233, 239, 0.06));
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-hero__subtitle,
.page-hero__description {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-md);
  max-width: 64ch;
}

.page-hero__summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  max-width: 64ch;
}

.page-hero__lead {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  max-width: 56ch;
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}
.page-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--color-surface-medium, rgba(230, 233, 239, 0.05));
  border: 1px solid var(--color-border-soft);
}

.page-hero__media {
  position: relative;
  display: grid;
  gap: var(--space-2);
  justify-items: center;
}
.page-hero__media img,
.page-hero__media video {
  width: min(520px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-soft);
  object-fit: cover;
  aspect-ratio: 4 / 3;
  background: var(--color-surface, rgba(230, 233, 239, 0.04));
  box-shadow: var(--shadow-soft);
}
.media-caption {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.page-hero__metrics {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.metric {
  padding: var(--space-3);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  background: var(--color-surface-xweak, rgba(230, 233, 239, 0.02));
  display: grid;
  gap: 0.35rem;
}
.metric__value {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-primary);
}
.metric__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.metric__description {
  margin: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
  justify-content: flex-start;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.04em;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.button:hover {
  transform: translateY(-2px);
}
.button--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: 0 12px 24px var(--shadow-primary-soft, rgba(43, 99, 255, 0.28));
}
.button--primary:hover {
  box-shadow: 0 18px 32px var(--shadow-primary-strong, rgba(43, 99, 255, 0.34));
}
.button--secondary {
  background: var(--color-surface-medium, rgba(230, 233, 239, 0.05));
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-soft);
}
.button--secondary:hover {
  border-color: var(--color-interactive, var(--color-primary));
  color: var(--color-interactive, var(--color-primary));
}

.section {
  padding-block: clamp(3rem, 7vh, 5rem);
}

.section--tinted {
  background: var(--color-surface-weak, rgba(230, 233, 239, 0.03));
  border-block: 1px solid var(--color-border-soft);
}
.section--tinted .container {
  background: var(--surface-glass, rgba(16, 31, 64, 0.55));
  border: 1px solid var(--color-border-glass, rgba(230, 233, 239, 0.08));
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  box-shadow: 0 30px 60px var(--shadow-ambient, rgba(0, 0, 0, 0.25));
  overflow: hidden;
}

.section .container {
  display: grid;
  gap: clamp(var(--space-4), 4vw, var(--space-6));
}

.section__head {
  margin-bottom: var(--space-4);
  display: grid;
  gap: var(--space-3);
  max-width: 720px;
}
.section--tinted .section__head { max-width: 100%; }

.section__title {
  margin: 0;
  font-size: clamp(1.75rem, 2vw + 1rem, 2.6rem);
  font-weight: 600;
}

.section__subtitle {
  margin: 0;
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
}

.section__description {
  margin: 0;
  color: var(--color-text-secondary);
  max-width: 68ch;
}

.section__footer {
  margin-top: var(--space-4);
  display: flex;
  justify-content: flex-start;
}

.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-xweak, rgba(230, 233, 239, 0.02));
  display: grid;
  gap: var(--space-3);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.card:hover {
  border-color: var(--color-interactive, var(--color-primary));
  transform: translateY(-4px);
}

.card__title {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.card__subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.card__meta {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card__media {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
}

.card__media img {
  width: 100%;
  border-radius: inherit;
  border: none;
  object-fit: cover;
  aspect-ratio: 16 / 10;
}

.card__actions {
  display: inline-flex;
  gap: var(--space-2);
  color: var(--color-interactive, var(--color-primary));
  font-size: var(--font-size-sm);
}

.gallery {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.gallery__item {
  display: grid;
  gap: var(--space-2);
}
.gallery__item img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  object-fit: cover;
  background: var(--color-surface-xweak, rgba(230, 233, 239, 0.02));
}
.gallery__item figcaption {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.richtext {
  display: grid;
  gap: var(--space-3);
  line-height: 1.75;
  color: var(--color-text-secondary);
  max-width: 68ch;
}
.richtext p {
  margin: 0;
}
.richtext ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}
.richtext a {
  color: var(--color-interactive, var(--color-primary));
}

.stats-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-faint, rgba(230, 233, 239, 0.015));
  display: grid;
  gap: var(--space-2);
  min-height: 100%;
  align-content: start;
}

.stat__value {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--color-primary);
}

.stat__label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.timeline {
  border-left: 1px solid var(--color-border-soft);
  padding-left: var(--space-5);
  display: grid;
  gap: var(--space-4);
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--glow-divider, rgba(22, 93, 255, 0.6)), transparent);
}

.timeline__item {
  position: relative;
  padding-left: var(--space-4);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(var(--space-5) * -1);
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.timeline__year {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.timeline__title {
  margin: 0;
  font-weight: 600;
}

.timeline__description {
  margin: 0;
  color: var(--color-text-secondary);
}

.list-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.list-grid__item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-faint, rgba(230, 233, 239, 0.015));
  min-height: 100%;
}

.list-grid__title {
  margin: 0;
  font-weight: 600;
}

.list-grid__text {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.contact-panel {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-soft);
  background: var(--color-surface-xweak, rgba(230, 233, 239, 0.02));
}
@media (min-width: 768px) {
  .contact-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.contact-list {
  display: grid;
  gap: var(--space-3);
  color: var(--color-text-secondary);
}

.contact-list__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-list__label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.hero {
  padding-block: clamp(2rem, 6vh, 4.5rem);
  display: flex;
  align-items: center;
}

.hero__layout {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
}

.hero__content {
  display: grid;
  gap: var(--space-4);
}

.hero__title {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.hero__description {
  margin: 0;
  color: var(--color-text-secondary);
  max-width: 34ch;
}

.hero__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.hero__stage {
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  position: relative;
  background: linear-gradient(145deg, var(--color-surface, rgba(230, 233, 239, 0.04)), transparent);
  box-shadow: var(--shadow-soft);
  padding: var(--space-4);
  min-height: clamp(260px, 45vh, 500px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 4) 画布全铺，不要再 clamp 宽高 */
#cube-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

#three-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.icp-footer {
  text-align: center;
  padding: var(--space-3) var(--space-4) var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.icp-footer a {
  color: inherit;
  text-decoration: none;
}

.icp-footer a:hover,
.icp-footer a:focus-visible {
  color: var(--color-primary);
}

/* 1) 用 dvh/svh 解决移动端地址栏收缩导致的 100vh 跳动 */
.cube-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 0;
  overflow: hidden;
  min-height: calc(100dvh - var(--header-height) - var(--footer-height));
  /* 2) 适配刘海安全区 */
  padding-top: max(0px, env(safe-area-inset-top));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.cube-main::before,
.cube-main::after{
  content: none;
}

.cube-main::before{
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);  /* 正中对齐 */
  width: clamp(480px, 70vmin, 900px);
  height: clamp(480px, 70vmin, 900px);
  border-radius: 50%;
  /* 双色叠加的径向渐变，中心亮、向外渐隐 */
  background:
    radial-gradient(circle at center, rgba(22, 93, 255, .28), transparent 60%),
    radial-gradient(circle at center, rgba(255, 125,   0, .16), transparent 70%);
  filter: blur(120px);
  opacity: .55;
  z-index: 0;
  pointer-events: none;
}

/* 3) 舞台 = 视口可容纳的最大正方形 */
.cube-main__stage {
  position: relative;
  z-index: 1;

  /* 宽度拉满视口 */
  width: 100vw;                  /* iOS/安卓更稳 */
  /* 高度按可视区(扣掉头脚) */
  height: calc(100dvh - var(--header-height) - var(--footer-height));

  /* 去掉强制正方形，否则会把高度拉成跟宽度一样 */
  aspect-ratio: auto;

  padding: clamp(8px, 2.5vw, 20px);
  border-radius: 0;
  border: 0;
  background: var(--cube-stage-background, linear-gradient(160deg, rgb(255, 255, 255), rgba(254, 255, 255, 0.986)));
  box-shadow: none;
  backdrop-filter: blur(24px);
  display: grid;
  place-items: center;
}

/* 旧浏览器兜底（不支持 dvh/svh） */
@supports not (width: 100svw) {
  .cube-main__stage {
    width: 100vw;
    height: calc(100vh - var(--header-height) - var(--footer-height));
  }
}

/* 4) 画布全铺 */
.cube-main__canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

.cube-main__canvas::before {
  content: '';
  position: absolute;
  inset: -6%;
  border-radius: 48px;
  border: 1px solid var(--color-border-glass, rgb(255, 255, 255));
  opacity: 0.45;
  background: radial-gradient(circle at center, var(--glow-surface, rgb(255, 255, 255)), transparent 75%);
  z-index: -1;
}

/* 5) 兼容旧浏览器：不支持 dvh/svw 时回退到 vh/vw */
@supports not (height: 100dvh) {
  .cube-main {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
  }
  .cube-main__stage {
    width: min(100vw, calc(100vh - var(--header-height) - var(--footer-height)));
    height: min(100vw, calc(100vh - var(--header-height) - var(--footer-height)));
  }
}

/* 6) 小屏再减一点圆角/内边距 */
@media (max-width: 480px) {
  .cube-main__stage {
    padding: 8px;
    border-radius: 20px;
    width: 105vw;
    height: 120vw;
  }
}

@media (min-width: 992px) {
  .page-hero__layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }

  .hero__layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  }
  .hero__description {
    max-width: 46ch;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
